package cn.pet.service.manage.service.impl;

import cn.pet.service.manage.entity.PetSubscribeOrder;
import cn.pet.service.manage.entity.dto.SubscribeOrderDTO;
import cn.pet.service.manage.entity.vo.SubscribeOrderDetailVO;
import cn.pet.service.manage.entity.vo.SubscribeOrderVO;
import cn.pet.service.manage.mapper.PetSubscribeOrderMapper;
import cn.pet.service.manage.service.PetSubscribeOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 预约服务信息 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-02-11
 */
@Service
public class PetSubscribeOrderServiceImpl extends ServiceImpl<PetSubscribeOrderMapper, PetSubscribeOrder> implements PetSubscribeOrderService {

    @Resource
    private PetSubscribeOrderMapper petSubscribeOrderMapper;

    @Override
    public List<SubscribeOrderVO> listByPage(SubscribeOrderDTO subscribeOrderDTO) {
        PageHelper.startPage(subscribeOrderDTO.getPageNum(),subscribeOrderDTO.getPageSize());
        return petSubscribeOrderMapper.listByLimit(subscribeOrderDTO);
    }

    @Override
    public List<SubscribeOrderVO> listByUserId(SubscribeOrderDTO subscribeOrderDTO) {
        return petSubscribeOrderMapper.listByLimit(subscribeOrderDTO);
    }

    @Override
    public SubscribeOrderDetailVO getDetail(String id) {
        return petSubscribeOrderMapper.queryById(id);
    }
}
